<%@ page isELIgnored="false" %> <!-- isELIgnored=true禁用表达式 -->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>支付-输入密码页面</title>
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/layui-v2.6.13/layui/css/layui.css"/>
            <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.min-2.1.1.js"></script>
            <script type="text/javascript" src="<%=request.getContextPath() %>/layui-v2.6.13/layui/layui.js"></script>
	</head>
	<body>
		<div style="width: 100%; margin: 0 auto;">
			<input type="password" class="layui-input" placeholder="请输入支付密码" id="pass">
			<br>
			<button class="layui-btn layui-btn-fluid" onclick="pay()">支付</button>
		</div>
		<script>
		    function pay(){
		        var pass = $("#pass").val();
		        console.info(${orderNo});
		        console.info(${uId});
		        //提交支付密码，扣款
		        $.ajax({
		            url:"pay",
		            data:"id="+${uId}+"&pass="+pass+"&orderNo="+${orderNo},
		            type:"post",
		            success: function(str){
		                console.info(str);
                        if(str == "1"){
                            alert("支付成功");
                            //支付成功，跳转到订单列表页
                        } else if(str == "2"){
                            alert("余额不足");
                        }else if(str == "3"){
                            alert("密码错误");
                        }else if (str == "4"){
                            alert("订单更新失败");
                        }else{
                            alert("更新账户余额失败");
                        }
		            }
		        });

		    }
		</script>
	</body>
</html>